package com.xcgame.superswiperefreshlayoutdemo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.xcgame.ssrl.SuperRecyclerView;

/**
 * Created by Administrator on 2018/2/12.
 */

public class MainActivity extends AppCompatActivity {

    private SuperRecyclerView srv_content;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        srv_content = findViewById(R.id.srv_content);

        srv_content.getRecyclerView().setLayoutManager(new LinearLayoutManager(this));
        srv_content.setAdapter(new TestAdapter());

    }

    private class TestAdapter extends RecyclerView.Adapter<TestAdapter.ViewHolder> {

        class ViewHolder extends RecyclerView.ViewHolder {
            public ViewHolder(View itemView) {
                super(itemView);
            }
        }

        @Override
        public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View itemView = LayoutInflater.from(MainActivity.this).inflate(R.layout.item_test, parent, false);
            return new ViewHolder(itemView);
        }

        @Override
        public void onBindViewHolder(ViewHolder holder, int position) {

        }

        @Override
        public int getItemCount() {
            return 20;
        }
    }

}
